//
//  OnetViewController.m
//  test
//
//  Created by qianfeng on 15/6/18.
//  Copyright (c) 2015年 qianfeng. All rights reserved.
//

#import "OnetViewController.h"

@interface OnetViewController ()

@end

@implementation OnetViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    [self initUI];
}
-(void)initUI
{
    UIButton *button=[UIButton buttonWithType:UIButtonTypeSystem];
    button.frame=CGRectMake(20, 80, self.view.frame.size.width-40, 40);
    [button setTitle:@"发送通知" forState:UIControlStateNormal];
    button.backgroundColor=[UIColor blueColor];
    button.titleLabel.font=[UIFont systemFontOfSize:18];
    button.layer.cornerRadius=8;
    [button addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:button];
}
-(void)findNotification:(NSNotification *)notification
{
    NSDictionary *ary=notification.userInfo;
    self.view.backgroundColor=ary[@"color"];
}
-(void)btnClick:(UIButton *)button
{
    NSNotificationCenter *center=[NSNotificationCenter defaultCenter];
    [center postNotificationName:@"mlz" object:self userInfo:@{@"color":[UIColor darkGrayColor]}];
    
}







@end
